//
//  ChooseLevelScene.m
//  jumpingfrog
//
//  Created by Tri Vo on 8/16/13.
//  Copyright 2013 Tri Vo. All rights reserved.
//

#import "ChooseLevelScene.h"
#import "GeneralDef.h"
#import "GameController.h"
#import "MenuScene.h"
#import "CustomItemSpriteWithText.h"
#import "SceneManager.h"

@implementation ChooseLevelScene

+ (CCScene *) scene {
    CCScene *scene = [CCScene node];
    ChooseLevelScene *layer = [ChooseLevelScene node];
    [scene addChild:layer];
    return scene;
}

- (id)init {
    if (self = [super init]) {
        [self initScreen];
    }
    return self;
}

- (void)dealloc {
    [super dealloc];
}

#pragma mark - Scene Actions

- (void) btnBack_Clicked {
    [[SceneManager getInstance] goMenu];
}

#pragma mark - Scene Methods

- (void) initScreen {
    CGSize winSize = [GameController getWinSize];
    // Background
    CCSprite *pBackground = [CCSprite spriteWithFile:IMG_BACKGROUND];
    [pBackground setAnchorPoint:CGPointZero];
    [pBackground setPosition:CGPointZero];
    [self addChild:pBackground];

    // Btn back
    CCMenuItemFont *pBtnBack = [CCMenuItemFont itemWithString:STR_BACK target:self selector:@selector(btnBack_Clicked)];
    CCMenu *pMenuBack = [CCMenu menuWithItems:pBtnBack, nil];
    [pMenuBack setPosition:CGPointMake(50, 30)];
    [self addChild:pMenuBack];
    
    CustomItemSpriteWithText *pTestItem = [[CustomItemSpriteWithText alloc] initwithNormalImage:NULL andSelectedImage:NULL andDisableImage:NULL withText:@"Hello" andFontSize:15 withTarget:self andSelector:@selector(btnTest_Clicked)];
    
    CCMenu *pMenuTest = [CCMenu menuWithItems:pTestItem, nil];
    [pMenuTest setPosition:CGPointMake(winSize.width/2, winSize.height/2)];
    [self addChild:pMenuTest];
    
}


@end
